var fs = require('fs')
var path = require('path')

const biaduTokenFile = path.join(__dirname, 'biadu_token.txt');
console.log(`biaduTokenFile:${biaduTokenFile}`)
let json = {
    expires_in: 2592000,
    refresh_token: '22.c21d5888a2f6b9333c3a1bb38532a5b1.315360000.1839916920.548409330-11070270',
    access_token: '21.9ac500478e1f4142287dda09accac50d.2592000.1527148920.548409330-11070270',
    session_secret: 'c51914c16dc8820c4cebdb557219b3e0',
    session_key: '9mnRfVsUDl07C3r1Fa2VWeEBwK61z7SOJwQzcZBhOTejratNM+SJ7ssaNioLlw+v/wl+NXFq80UDuV79r0XkcINbG+vi0jpPBg==',
    scope: 'basic'
}

fs.writeFileSync(biaduTokenFile, JSON.stringify(json))
const tokenData = fs.readFileSync(biaduTokenFile,'utf-8')
console.log(tokenData)
console.log('second:', Number.parseInt(new Date().getTime()/ 1000,10))

